home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / libsrc / gethotky.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  474 b   |  29 lines

  1. /*
  2. ** gethotky.c
  3. **
  4. ** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. #include <stdio.h>
  9. #include <string.h>
  10. #include "pictor.h"
  11.  
  12. /*
  13. ** Returns the hotkey (the alpha-numeric character following
  14. ** the first '~') from str or 0 if str has no hotkey.
  15. */
  16. int gethotkey(char *str)
  17. {
  18.     int c = 0;
  19.     char *ptr;
  20.  
  21.     ptr = strchr(str,'~');
  22.  
  23.     if(ptr != NULL)
  24.         c = (int)*(ptr + 1);
  25.  
  26.     return(c);
  27.  
  28. } /* gethotkey */
  29.